package com.refusea.train.controller

import com.refusea.train.domain.helper.LogoutHelper
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/3/26
 **/
@RestController
@RequestMapping("/api")
class LogoutController(private val logoutHelper: LogoutHelper) {

    @GetMapping("/logout")
    fun logout(@RequestHeader("Authorization") authentication: String?) {
        logoutHelper.logout(authentication)
    }
}
